#include<stdio.h>
int main()
{	
    long sum,t;
    int i,n;
	printf("Your input n=");
	scanf("%d",&n);
	t=1;
	sum=0;
	for (i=1;i<=n;i++){
		t=t*i;
		sum=sum+t;
	}
    printf("Sum is %lld\n",sum);	
}

